<?php
/**
 * Created by PhpStorm.
 * User: Hello pan
 * Date: 9/13/25
 * Time: 6:37 PM
 */

use yii\bootstrap4\Nav;
use yii\bootstrap4\NavBar;
use yii\helpers\Html;
use yii\web\View;


?>
<?php $this->beginPage() ?>

<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>" class="h-100">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!--    设置meta 标签 -->
    <?php $this->registerMetaTag(['name' => '关键词','content' => '我是mete内容'])?>
    <?php $this->registerCsrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body class="d-flex flex-column h-100">
<?php $this->beginBody() ?>


<header>
    <h2>我是header</h2>
<?php

NavBar::begin([
        'brandLabel' => Yii::$app->name,
        'brandUrl' => Yii::$app->homeUrl,
        'options' => ['class' => 'navbar navbar-expand-md navbar-dark bg-dark fixed-top']
]);


echo Nav::widget([
        'options' => ['class' => 'navbar-nav'],
        'items' => [
                ['label' => 'Home' ,'url' => ['/site/index']],
                ['label' => 'about' ,'url' => ['/site/about']],
                ['label' => 'Contact' ,'url' => ['/site/contact']],
        ],
]);

NavBar::end();

?>


</header>

<main role="main" class="flex-shrink-0">
    <div class="container">
<!--        面包屑   -->
        <?= \yii\widgets\Breadcrumbs::widget([
                'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs']:[]
        ]) ?>
        <?= \app\widgets\Alert::widget()?>

        <?= $content ?>

    </div>

</main>

<footer class="footer mt-auto py-3 text-muted">
    我是底部
</footer>

<?php \Yii::$app->view->on(View::EVENT_END_BODY, function () {
    echo date('Y-m-d');
});?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

